#include "udp.h"
#include <iostream>
#include <string.h>
using namespace std;

int main(int argc, char *argv[])
{
    if (argc < 2)
	{
        perror("ERROR, no port provided\n");
        exit(1);
    }
    char buff[20], pass[]="password";
    Udp client;
    int puerto, x=1;
    puerto=atoi(argv[1]);
    client.enviar(pass, puerto ,argv[2]);
    cout<<client.recibir()<<endl;
        while (x==1)
	{
	cin>>buff;
        if(strcmp(buff,"Salir")==0){
		x=0;		
		}
	client.enviar(buff);
    cout<<client.recibir()<<endl;
	}
return 0;
}
